#!/bin/bash

#export SRC_PATH=../upload/media/*.mp4
#export DST_PATH=../upload/media/output/
#export LD_LIBRARY_PATH="./:$LD_LIBRARY_PATH"

export SRC_PATH=/vdb1/518_hubei/app/roadshowcenter_app/wwwroot/upload/media/*.mp4
export DST_PATH=/vdb1/518_hubei/app/roadshowcenter_app/wwwroot/upload/media/output/
export LD_LIBRARY_PATH="/vdb1/convert:$LD_LIBRARY_PATH"



while [ "1" = "1" ]
	do
		for fn in $SRC_PATH 
			do
				echo -e "\033[41;37m =====  $fn ==== \033[0m" 
				if test -f $fn
				then
					/vdb1/convert/ffmpeg  -i $fn -acodec libfaac -vcodec h264 -f mp4 $DST_PATH$(basename $fn .mp4).m
					mv $DST_PATH$(basename $fn .mp4).m $DST_PATH${fn##*/}
					rm -rf $fn
				fi
			
				echo -e "\033[41;37m =====  $fn ==== \033[0m" 
			done
		sleep 3
	done
